class DlgConfirm extends Dlg
public var yesButton;
public var noButton;

var body;
var label;
var doYes;
var doNo;
function DlgConfirm(text,doYes,doNo){
	this.doYes=doYes;
	this.doNo=doNo;
	this.addChild([
		[{dim:"body",pos:[0,0,510,250],bg:["#fff","#888",6],mask:true},
			[new Label(text),{dim:"label",pos:[40,75,430],multi:true,align:"c"}],
			[new Button(["取消","#000"]),{dim:"noButton",pos:[0,"b","f/2",85],bg:["#fff",["#eee"]]}],
			[new Button(["确定","#0b0"]),{dim:"yesButton",pos:["r","b","f/2",85],bg:["#fff",["#eee",,"#eee"]]}],
		]
	]);
	var h=this.label.getClientH();
	if(h>40) this.label.setAlign("left");
	h+=220;
	this.body.setPos("c","c",this.body.w,h);
	this.yesButton.setPos("r","b");
	this.noButton.setPos(0,"b");
	this.base.transit({alpha:[0,0.4],time:200});
}
function onClose(){
	this.remove();
	call(this.doBack);
}
function onButtonClick(){
	this.close();
	call(G.target==this.yesButton?this.doYes:this.doNo);
}